package com.itheima.mMothodDemo;

/*
    比较相同数据类型数组的内容是否相同
 */
public class Work04 {
    public static void main(String[] args) {
        int[] arr1 = {1, 2, 3};
        int[] arr2 = {1, 2, 40};
        int[] arr3 = {1, 2, 3};
        System.out.println(compare(arr1, arr2));
        System.out.println(compare(arr1, arr3));
    }

    public static boolean compare(int[] arr, int[] brr) {
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == brr[i]) {
                continue;
            } else if (i == arr.length - 1) {
                return false;
            }
        }
        return true;
    }
}
